package com.konne.nightmare.FastPublicOpinion.ui.information.activity;

import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.BarUtils;
import com.blankj.utilcode.util.FragmentUtils;
import com.konne.nightmare.FastPublicOpinion.R;
import com.konne.nightmare.FastPublicOpinion.base.BaseMvpActivity;
import com.konne.nightmare.FastPublicOpinion.base.IBaseMvpView;
import com.konne.nightmare.FastPublicOpinion.mvp.presenter.CreateGroupPresenter;
import com.konne.nightmare.FastPublicOpinion.mvp.view.ICreateGroupView;
import com.konne.nightmare.FastPublicOpinion.utils.LoadProgressDialog;

/**
 * Create by ws.
 * on Data:2022/1/25  Time:下午 1:00.
 * description: ** .
 */
public class CreateGroupActivity  extends BaseMvpActivity<ICreateGroupView, CreateGroupPresenter> implements ICreateGroupView {
    private int type;
    /**
     * @param type 0：指定 1：系统随机 2：学生自由，，3指定组管理，4系统随机组管理，5，学生自由组管理
     * */
    public static void start(int type){
        Intent intent=new Intent(ActivityUtils.getTopActivity(),CreateGroupActivity.class);
        intent.putExtra("type",type);
        ActivityUtils.startActivity(intent);
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    protected CreateGroupPresenter createPresenter() {
        return new CreateGroupPresenter();
    }

    @Override
    public int getLayout() {
        return R.layout.activity_create_group;
    }

    @Override
    public void initView() {
        BarUtils.transparentStatusBar(this);
        BarUtils.setStatusBarLightMode(this,true);
    }

    @Override
    public void setFragment(Fragment fragment) {
        FragmentUtils.add(getSupportFragmentManager(),fragment,R.id.fl_content);
        FragmentUtils.show(fragment);
    }

    @Override
    public void initData(Bundle savedInstanceState) {
        type=getIntent().getIntExtra("type",1);
        mPresenter.init(type);
    }

    @Override
    public LoadProgressDialog getLoadDialog() {
        return null;
    }

    @Override
    public void cancelLoadDialog() {

    }
}
